home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu086.dms / pu086.adf / clibs / AmigaDOS.doc < prev    next >
Text File  |  1990-12-04  |  15KB  |  533 lines

  1.  (c) 1990 S.Hawtin.Permission is granted to copy this file provided
  2.   1) It is not used for commercial gain
  3.   2) This notice is included in all copies
  4.   3) Altered copies are marked as such
  5.  
  6.   No liability is accepted for the contents of the file.
  7.  
  8.    AmigaDOS.doc within        Public Domain C library
  9.  
  10.   This file contains a list of the AmigaDOS stubs that are included 
  11. within the NorthC standard library.  The routines are listed by library.
  12.  
  13.   When your program starts the routines in "crt0.asm" will automagically 
  14. load "dos.library", "exec.library" and "mathffp.library", the 
  15. "mathtrans.library" is loaded as soon as you try to use it, all other 
  16. libraries must be loaded explicitly by your program.
  17.  
  18.   The OpenLibrary() routine in the NorthC 'C' library does more than 
  19. just open the library, it keeps a record of the library pointers and closes 
  20. them when the program ends, if you want to call the real OpenLibrary() 
  21. routine it is called _OpenLibrary().  Similarly the CloseLibrary() routine 
  22. tidies some things up, the real routine is called _CloseLibrary().  
  23. Calling the real routines in NorthC programs may result in nasty errors.
  24.  
  25.   If you use the OpenLibrary() routine all the linking is done for you, 
  26. you do not need to remember the name of a global variable that needs the 
  27. library pointer, for example
  28.  
  29.     int
  30.     next_name(new_str,old_str)
  31.         char *new_str;
  32.         char *old_str;
  33.        {/* All library calls require long arguments everywhere */
  34.         static int first = -1;
  35.  
  36.         if(first)
  37.            {/* Assumes load suceeds, in a real program test for NULL
  38.                return */
  39.             OpenLibrary("icon.library",0L);
  40.             first = 0;
  41.             }
  42.         return(BumpRevision(new_str,old_str));
  43.         }
  44.  
  45. you do not even have to remember to close the library, the OpenLibrary() 
  46. routine sets things so that the exit() routine will do it for you.
  47.  
  48.   All the arguments to AmigaDOS routines are 4 bytes long, even when 
  49. the documentation claims they are not.  For example the "graphics.library" 
  50. Move() function should be defined as
  51.  
  52.     Move(rp,x,y)
  53.         struct RastPort *rp;
  54.         SHORT x,y;
  55.  
  56. within this version of the NorthC library it is defined as
  57.  
  58.     Move(rp,x,y)
  59.         struct RastPort *rp;
  60.         LONG x,y;
  61.  
  62. this means that you may have to alter your source code to read, for example 
  63.  
  64.     short x;
  65.  
  66.     #ifdef NORTHC
  67.         Move(rp,(long)x,50L);
  68.     #else
  69.         Move(rp,x,50);
  70.     #endif
  71.  
  72. or risk getting some nasty behaviour from your machine.  The routines 
  73. within"graphics.library" are the only ones I have seen so far that say 
  74. they take short arguments.
  75.  
  76.   The "mathsieeedoubbas.library" and "mathsieeedoubtrans.library" are 
  77. notsupported, I could not work out how to return 64 bits in the D0 
  78. register,maybe I will for a future release.
  79.  
  80.   Right having introduced the functions here they are, the rest of this 
  81. file lists the AmigaDOS routines that are supported by the standard NorthC 
  82. 'C' library.
  83.  
  84.  
  85. amiga.lib
  86.  
  87.     CreatePort(name,private)
  88.     CreateExtIO(reply,size)
  89.     DeletePort(port)
  90.     DeleteExtIO(ioExt)
  91.     NewList(msgList)
  92.  
  93. diskfont.library
  94.  
  95.     AvailFonts(buffer,bufBytes,flags)
  96.     DisposeFontContents(fontContentsHeader)
  97.     NewFontContents(fontsLock,fontName)
  98.     OpenDiskFont(textAttr)
  99.  
  100. dos.library
  101.  
  102.     Close(file)
  103.     CreateDir(name)
  104.     CreateProc(name,pri,segList,stackSize)
  105.     CurrentDir(lock)
  106.     DateStamp(date)
  107.     Delay(timeout)
  108.     DeleteFile(name)
  109.     DeviceProc(name)
  110.     DupLock(lock)
  111.     Examine(lock,fileInfoBlock)
  112.     Execute(string,fileIn,fileOut)
  113.     Exit(returnCode)
  114.     ExNext(lock,fileInfoBlock)
  115.     GetPacket(wait)
  116.     Info(lock,parameterBlock)
  117.     Input()
  118.     IoErr()
  119.     IsInteractive(file)
  120.     LoadSeg(fileName)
  121.     Lock(name,type)
  122.     Open(name,AccessMode)
  123.     Output()
  124.     ParentDir(lock)
  125.     QueuePacket(packet)
  126.     Read(file,buffer,length)
  127.     Rename(oldName,newName)
  128.     Seek(file,position,offset)
  129.     SetComment(name,comment)
  130.     SetProtection(name,mask)
  131.     UnLoadSeg(segment)
  132.     UnLock(lock)
  133.     WaitForChar(file,timeout)
  134.     Write(file,buffer,length)
  135.  
  136. exec.library
  137.  
  138.     AbortIO(ioRequest)
  139.     AddDevice(device)
  140.     AddHead(list,node)
  141.     AddIntServer(intNumber,interrupt)
  142.     AddLibrary(library)
  143.     AddMemList(size,attrib,pri,base,name)
  144.     AddPort(port)
  145.     AddResource(resource)
  146.     AddSemaphore(sigSem)
  147.     AddTail(list,node)
  148.     AddTask(task,initPC,finalPC)
  149.     Alert(alertNum,parameters)
  150.     AllocAbs(byteSize,location)
  151.     Allocate(freeList,byteSize)
  152.     AllocEntry(entry)
  153.     AllocMem(byteSize,requirements)
  154.     AllocSignal(signalNum)
  155.     AllocTrap(trapNum)
  156.     AttemptSemaphore(sigSem)
  157.     AvailMem(requirements)
  158.     Cause(interrupt)
  159.     CheckIO(ioRequest)
  160.     CloseDevice(ioRequest)
  161.     _CloseLibrary(library)
  162.     CopyMem(source,dest,size)
  163.     CopyMemQuick(source,dest,size)
  164.     Deallocate(freeList,memBlock,byteSize)
  165.     Debug()
  166.     Disable()
  167.     Dispatch()
  168.     DoIO(ioRequest)
  169.     Enable()
  170.     Enqueue(list,node)
  171.     Exception()
  172.     ExitIntr()
  173.     FindName(list,name)
  174.     FindPort(name)
  175.     FindResident(name)
  176.     FindSemaphore(sigSem)
  177.     FindTask(name)
  178.     Forbid()
  179.     FreeEntry(entry)
  180.     FreeMem(memBlock,byteSize)
  181.     FreeSignal(signalNum)
  182.     FreeTrap(trapNum)
  183.     GetCC()
  184.     GetMsg(port)
  185.     InitCode(startClass,version)
  186.     InitResident(resident,segList)
  187.     InitSemaphore(sigSem)
  188.     InitStruct(initTable,memory,size)
  189.     Insert(list,node,pred)
  190.     MakeFunctions(target,funcArray,funcDispBase)
  191.     MakeLibrary(fInit,sInit,lInit,dsize,cSize)
  192.     ObtainSemaphore(sigSem)
  193.     ObtainSemaphoreList(sigSem)
  194.     OldOpenLibrary(libName)
  195.     OpenDevice(devName,unit,ioRequest,flags)
  196.     _OpenLibrary(libName,version)
  197.     OpenResource(resName,version)
  198.     Permit()
  199.     Procure(semaport,bidMsg)
  200.     PutMsg(port,message)
  201.     RawDoFmt()
  202.     RawIOInit()
  203.     RawMayGetChar()
  204.     RawPutChar(char)
  205.     ReleaseSemaphore(sigSem)
  206.     ReleaseSemaphoreList(sigSem)
  207.     RemDevice(device)
  208.     RemHead(list)
  209.     RemIntServer(intNumber,interrupt)
  210.     RemLibrary(library)
  211.     Remove(node)
  212.     RemPort(port)
  213.     RemResource(resource)
  214.     RemSemaphore(sigSem)
  215.     RemTail(list)
  216.     RemTask(task)
  217.     ReplyMsg(message)
  218.     Reschedule()
  219.     Schedule()
  220.     SendIO(ioRequest)
  221.     SetExcept(newSig,signalSet)
  222.     SetFunction(library,funcOffset,funcEntry)
  223.     SetIntVector(intNumber,interrupt)
  224.     SetSignal(newSig,signalSet)
  225.     SetSR(newSR,mask)
  226.     SetTaskPri(task,priority)
  227.     Signal(task,signalSet)
  228.     SumKickData()
  229.     SumLibrary(library)
  230.     SuperState()
  231.     Supervisor()
  232.     Switch()
  233.     TypeOfMem(address)
  234.     UserState(sysStack)
  235.     Vacate(semaport)
  236.     Wait(signalSet)
  237.     WaitIO(ioRequest)
  238.     WaitPort(port)
  239.  
  240. expansion.library
  241.  
  242.     AddConfigDev(configDev)
  243.     AddDosNode(bootPri,flags,dosNode)
  244.     AllocBoardMem(slotSpec)
  245.     AllocConfigDev()
  246.     AllocExpansionMem(numSlots,slotAlign,slotOffset)
  247.     ConfigBoard(board,configDev)
  248.     ConfigChain(baseAddr)
  249.     expansionUnused()
  250.     FindConfigDev(oldConfigDev,manufacturer,product)
  251.     FreeBoardMem(startSlot,slotSpec)
  252.     FreeConfigDev(configDev)
  253.     FreeExpansionMem(startSlot,numSlots)
  254.     GetCurrentBinding(curBind,bindSize)
  255.     MakeDosNode(parmPacket)
  256.     ObtainConfigBinding()
  257.     ReadExpansionByte(board,offset)
  258.     ReadExpansionRom(board,configDev)
  259.     ReleaseConfigBinding()
  260.     RemConfigDev(configDev)
  261.     SetCurrentBinding(curBind,bindSize)
  262.     WriteExpansionByte(board,offset,byte)
  263.  
  264. graphics.library
  265.  
  266.     AddAnimOb(obj,animationKey,rastPort)
  267.     AddBob(bob,rastPort)
  268.     AddFont(textFont)
  269.     AddVSprite(vSprite,rastPort)
  270.     AllocRaster(width,height)
  271.     AndRectRegion(rgn,rect)
  272.     AndRegionRegion(src,dst)
  273.     Animate(animationKey,rastPort)
  274.     AreaDraw(rastPort,x,y)
  275.     AreaElipse(rPort,cx,cy,a,b)
  276.     AreaEnd(rastPort)
  277.     AreaMove(rastPort,x,y)
  278.     AskFont(rastPort,textAttr)
  279.     AskSoftStyle(rastPort)
  280.     AttemptLockLayerRom(layer)
  281.     BltBitMap(sBitMap,sX,sY,dBitMap,dX,dY,szX,szY,mnt,msk,t)
  282.     BltBitMapRastPort(src,sx,sy,dest,dX,dY,szX,szY,mint)
  283.     BltClear(memory,size,flags)
  284.     BltMaskBitMapRastPort(src,sx,sy,dest,dX,dY,szX,szY,mint,bMask)
  285.     BltPattern(rastPort,ras,xl,yl,maxX,maxY,fillBytes)
  286.     BltTemplate(src,sX,sMod,dRastPort,dX,dY,szX,szY)
  287.     CBump(copperList)
  288.     ChangeSprite(vp,simplesprite,data)
  289.     ClearEOL(rastPort)
  290.     ClearRegion(rgn)
  291.     ClearScreen(rastPort)
  292.     ClipBlit(src,sX,sY,dest,dX,dY,szX,szY,mint)
  293.     CloseFont(textFont)
  294.     CMove(copperList,destination,data)
  295.     CopySBitMap(l1,l2)
  296.     CWait(copperList,x,y)
  297.     DisownBlitter()
  298.     DisposeRegion(rgn)
  299.     DoCollision(rasPort)
  300.     Draw(rastPort,x,y)
  301.     DrawElipse(rPort,cx,cy,a,b)
  302.     DrawGList(rastPort,viewPort)
  303.     Flood(rastPort,mode,x,y)
  304.     FreeColorMap(colormap)
  305.     FreeCopList(coplist)
  306.     FreeCprList(cprlist)
  307.     FreeGBuffers(animationObj,rastPort,doubleBuffer)
  308.     FreeRaster(planeptr,width,height)
  309.     FreeSprite(num)
  310.     FreeVPortCopLists(viewport)
  311.     GetColorMap(entries)
  312.     GetGBuffers(animationObj,rastPort,doubleBuffer)
  313.     GetRGB4(colormap,entry)
  314.     GetSprite(simplesprite,num)
  315.     GraphicsReserved1()
  316.     GraphicsReserved2()
  317.     InitArea(areaInfo,vectorTable,vectorTableSize)
  318.     InitBitMap(bitMap,depth,width,height)
  319.     InitGels(dummyHead,dummyTail,GelsInfo)
  320.     InitGMasks(animationObj)
  321.     InitMasks(vSprite)
  322.     InitRastPort(rastPort)
  323.     InitTmpRas(tmpras,buff,size)
  324.     InitView(view)
  325.     InitVPort(viewPort)
  326.     LoadRGB4(viewPort,colors,count)
  327.     LoadView(view)
  328.     LockLayerRom(layer)
  329.     MakeVPort(view,viewPort)
  330.     Move(rastPort,x,y)
  331.     MoveSprite(viewport,simplesprite,x,y)
  332.     MrgCop(view)
  333.     NewRegion()
  334.     NotRegion(rgn)
  335.     OpenFont(textAttr)
  336.     OrRectRegion(rgn,rect)
  337.     OrRegionRegion(src,dst)
  338.     OwnBlitter()
  339.     PolyDraw(rastPort,count,polyTable)
  340.     QBlit(blit)
  341.     QBSBlit(blit)
  342.     ReadPixel(rastPort,x,y)
  343.     RectFill(rastPort,xl,yl,xu,yu)
  344.     RemFont(textFont)
  345.     RemIBob(bob,rastPort,viewPort)
  346.     RemVSprite(vSprite)
  347.     ScrollRaster(rastPort,dX,dY,minx,miny,maxx,maxy)
  348.     ScrollVPort(vp)
  349.     SetAPen(rastPort,pen)
  350.     SetBPen(rastPort,pen)
  351.     SetCollision(type,routine,gelsInfo)
  352.     SetDrMd(rastPort,drawMode)
  353.     SetFont(RastPortID,textFont)
  354.     SetRast(rastPort,color)
  355.     SetRGB4(viewPort,index,r,g,b)
  356.     SetRGB4CM(cm,i,r,g,b)
  357.     SetSoftStyle(rastPort,style,enable)
  358.     SortGList(rastPort)
  359.     SyncSBitMap(l)
  360.     Text(RastPort,string,count)
  361.     TextLength(RastPort,string,count)
  362.     UCopperListInit(copperlist,num)
  363.     UnlockLayerRom(layer)
  364.     VBeamPos()
  365.     WaitBlit()
  366.     WaitBOVP(viewport)
  367.     WaitTOF()
  368.     WritePixel(rastPort,x,y)
  369.     XorRectRegion(rgn,rect)
  370.     XorRegionRegion(src,dst)
  371.  
  372. icon.library
  373.  
  374.     AddFreeList(freelist,mem,size)
  375.     AllocWBObject()
  376.     BumpRevision(newname,oldname)
  377.     FindToolType(toolTypeArray,typeName)
  378.     FreeDiskObject(diskobj)
  379.     FreeFreeList(freelist)
  380.     FreeWBObject(WBObject)
  381.     GetDiskObject(name)
  382.     GetIcon(name,icon,freelist)
  383.     GetWBObject(name)
  384.     MatchToolValue(typeString,value)
  385.     PutDiskObject(name,diskobj)
  386.     PutIcon(name,icon)
  387.     PutWBObject(name,object)
  388.  
  389. intuition.library
  390.  
  391.     ActivateGadget(Gad,Window,Req)
  392.     ActivateWindow(Window)
  393.     AddGadget(AddPtr,Gadget,Position)
  394.     AddGList(aPtr,Gad,Pos,NumGad,Req)
  395.     AllocRemember(RememberKey,Size,Flags)
  396.     AlohaWorkbench(wbport)
  397.     AutoRequest(Window,Body,PText,NText,PFlag,NFlag,W,H)
  398.     BeginRefresh(Window)
  399.     BuildSysRequest(Window,Body,PosText,NegText,Flags,W,H)
  400.     ClearDMRequest(Window)
  401.     ClearMenuStrip(Window)
  402.     ClearPointer(Window)
  403.     CloseScreen(Screen)
  404.     CloseWindow(Window)
  405.     CloseWorkBench()
  406.     CurrentTime(Seconds,Micros)
  407.     DisplayAlert(AlertNumber,String,Height)
  408.     DisplayBeep(Screen)
  409.     DoubleClick(sseconds,smicros,cseconds,cmicros)
  410.     DrawBorder(RPort,Border,LeftOffset,TopOffset)
  411.     DrawImage(RPort,Image,LeftOffset,TopOffset)
  412.     EndRefresh(Window,Complete)
  413.     EndRequest(requester,window)
  414.     FreeRemember(RememberKey,ReallyForget)
  415.     FreeSysRequest(Window)
  416.     GetDefPrefs(preferences,size)
  417.     GetPrefs(preferences,size)
  418.     GetScreenData(buffer,size,type,screen)
  419.     InitRequester(req)
  420.     IntuiTextLength(itext)
  421.     Intuition(ievent)
  422.     ItemAddress(MenuStrip,MenuNumber)
  423.     LockIBase(dontknow)
  424.     MakeScreen(Screen)
  425.     ModifyIDCMP(Window,Flags)
  426.     ModifyProp(Gadget,Ptr,Req,Flags,HPos,VPos,HBody,VBody)
  427.     MoveScreen(Screen,dx,dy)
  428.     MoveWindow(window,dx,dy)
  429.     NewModifyProp(Gad,Ptr,Req,Flg,hPs,vPs,hBdy,vBdy,NumG)
  430.     OffGadget(Gadget,Ptr,Req)
  431.     OffMenu(Window,MenuNumber)
  432.     OnGadget(Gadget,Ptr,Req)
  433.     OnMenu(Window,MenuNumber)
  434.     OpenIntuition()
  435.     OpenScreen(OSargs)
  436.     OpenWindow(OWargs)
  437.     OpenWorkBench()
  438.     PrintIText(rp,itext,left,top)
  439.     RefreshGadgets(Gadgets,Ptr,Req)
  440.     RefreshGList(Gadgets,Ptr,Req,NumGad)
  441.     RefreshWindowFrame(Window)
  442.     RemakeDisplay()
  443.     RemoveGadget(RemPtr,Gadget)
  444.     RemoveGList(RemPtr,Gad,NumGad)
  445.     ReportMouse(Window,Boolean)
  446.     Request(Requester,Window)
  447.     RethinkDisplay()
  448.     ScreenToBack(Screen)
  449.     ScreenToFront(Screen)
  450.     SetDMRequest(Window,req)
  451.     SetMenuStrip(Window,Menu)
  452.     SetPointer(Window,Pointer,Height,Width,Xoffset,Yoffset)
  453.     SetPrefs(preferences,size,flag)
  454.     SetWindowTitles(window,windowtitle,screentitle)
  455.     ShowTitle(Screen,ShowIt)
  456.     SizeWindow(window,dx,dy)
  457.     UnlockIBase(IBLock)
  458.     ViewAddress()
  459.     ViewPortAddress(window)
  460.     WBenchToBack()
  461.     WBenchToFront()
  462.     WindowLimits(window,minwidth,minheight,maxwidth,maxheight)
  463.     WindowToBack(window)
  464.     WindowToFront(window)
  465.  
  466. layers.library
  467.  
  468.     BeginUpdate(layer)
  469.     BehindLayer(li,layer)
  470.     CreateBehindLayer(li,bm,x0,y0,x1,y1,flags,bm2)
  471.     CreateUpfrontLayer(li,bm,x0,y0,x1,y1,flags,bm2)
  472.     DeleteLayer(li,layer)
  473.     DisposeLayerInfo(li)
  474.     EndUpdate(layer,flag)
  475.     FattenLayerInfo(li)
  476.     InitLayers(li)
  477.     InstallClipRegion(layer,region)
  478.     LockLayer(li,layer)
  479.     LockLayerInfo(li)
  480.     LockLayers(li)
  481.     MoveLayer(li,layer,dx,dy)
  482.     MoveLayerInFrontOf(layer_to_move,layer_to_be_infront_of)
  483.     NewLayerInfo()
  484.     ScrollLayer(li,layer,dx,dy)
  485.     SizeLayer(li,layer,dx,dy)
  486.     SwapBitsRastPortClipRect(rp,cr)
  487.     ThinLayerInfo(li)
  488.     UnlockLayer(layer)
  489.     UnlockLayerInfo(li)
  490.     UnlockLayers(li)
  491.     UpfrontLayer(li,layer)
  492.     WhichLayer(li,x,y)
  493.  
  494. mathffp.library
  495.  
  496.     SPAbs(fnum1)
  497.     SPAdd(fnum1,fnum2)
  498.     SPCeil(fnum1)
  499.     SPCmp(fnum1,fnum2)
  500.     SPDiv(fnum1,fnum2)
  501.     SPFix(fnum1)
  502.     SPFloor(fnum1)
  503.     SPFlt(num1)
  504.     SPMul(fnum1,fnum2)
  505.     SPNeg(fnum1)
  506.     SPSub(fnum1,fnum2)
  507.     SPTst(fnum1)
  508.  
  509. mathtrans.library
  510.  
  511.     SPAcos(num1)
  512.     SPAsin(num1)
  513.     SPAtan(num1)
  514.     SPCos(num1)
  515.     SPCosh(num1)
  516.     SPExp(num1)
  517.     SPFieee(num1)
  518.     SPLog(num1)
  519.     SPLog10(num1)
  520.     SPPow(num1,num2)
  521.     SPSin(num1)
  522.     SPSincos(num1,num2)
  523.     SPSinh(num1)
  524.     SPSqrt(num1)
  525.     SPTan(num1)
  526.     SPTanh(num1)
  527.     SPTieee(num1)
  528.  
  529. translator.library
  530.  
  531.     Translate(inStr,inLen,oBuf,bSize)
  532.  
  533.